
package com.hlkj.pay.app.merchant;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import com.hlkj.framework.common.pojo.CommonResult;
import com.hlkj.framework.common.pojo.PageResult;
import com.hlkj.pay.dto.merchant.MerchantAccessDto;
import com.hlkj.pay.dto.merchant.MerchantWechatConfigDto;
import com.hlkj.pay.enums.PayEnums;
import com.hlkj.pay.infrastructure.model.merchant.MerchantAccessAuthDO;
import com.hlkj.pay.vo.merchant.req.access.*;
import com.hlkj.pay.vo.merchant.resp.access.MerchantAccessAuthDetailResp;
import com.hlkj.pay.vo.merchant.resp.access.MerchantAccessAuthResp;
import com.hlkj.pay.vo.merchant.resp.access.MerchantAccessResp;
import com.hlkj.pay.vo.openapi.merchant.req.access.OpenApiMerchantAccessQueryReq;
import com.hlkj.pay.vo.openapi.merchant.req.access.OpenApiMerchantAccessReq;
import com.hlkj.pay.vo.order.req.MerchantChannelSplitReq;
import com.hlkj.pay.vo.order.req.MerchantProductReq;
import com.hlkj.pay.vo.order.req.MerchantTermAddReq;
import com.hlkj.pay.vo.order.resp.MerchantProductQueryResp;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;

/**
 * @author HlpayTeam
 * @date 2024/09/12 11:39
 */
public interface IMerchantAccessAppService {

    /**
     * 商户保存进件
     *
     * @param merchantAccessReq
     * @return
     */
    CommonResult<Long> saveAccess(MerchantAccessReq merchantAccessReq);

    /**
     * 商户提交进件
     *
     * @param merchantAccessReq
     * @return
     */
    CommonResult<Long> submitAccess(@Valid MerchantAccessReq merchantAccessReq);

    /**
     *
     * @param merchantTermAddReq
     * @return
     */
    CommonResult<MerchantAccessDto> submitAccess(@Valid OpenApiMerchantAccessReq merchantTermAddReq);

    /**
     * 进件详情
     *
     * @param id
     * @return
     */
    CommonResult<MerchantAccessResp> merchantAccessInfo(Long id);

    /**
     * 后台审核
     *
     * @param merchantAccessApproveReq
     */
    CommonResult<Void> platApprove(MerchantAccessApproveReq merchantAccessApproveReq);

    /**
     * 进件的通道
     *
     * @param merchantAccessChannelReq
     * @return
     */
    CommonResult<Void> accessChannel(MerchantAccessChannelReq merchantAccessChannelReq);

    /**
     * 进件删除
     *
     * @param id
     * @return
     */
    CommonResult<Void> delete(Long id);

    /**
     *
     * @param id
     * @return
     */
    CommonResult<MerchantAccessAuthResp> queryMerchantAccessAuth(Long id);

    /**
     *
     * @param merchantAccessChannelReq
     * @return
     */
    CommonResult<Void> submitWechatConfig(MerchantWechatConfigDto merchantAccessChannelReq);

    /**
     *
     * @param merchantTermAddReq
     * @return
     */
    CommonResult<String> fuiouTermAdd(@Valid MerchantTermAddReq merchantTermAddReq);

    /**
     *
     * @param merchantAccessRechargeReq
     * @return
     */
    CommonResult<String> merchantAccessRecharge(MerchantAccessRechargeReq merchantAccessRechargeReq);

    /**
     *
     * @param accessQueryReq
     * @return
     */
    CommonResult<MerchantAccessDto> accessDetail(OpenApiMerchantAccessQueryReq accessQueryReq);

    /**
     * 易生支付宝/微信子商户号拆分
     *
     * @param merchantChannelSplitReq
     * @return
     */
    CommonResult<MerchantChannelSplitReq> easySplit(@Valid MerchantChannelSplitReq merchantChannelSplitReq);


    CommonResult<Void> importExcel(Long accessId, MultipartFile excel);

    /**
     * 分页查询AUT信息
     * @param merchantAccessAuthPageReq
     * @return
     */
    CommonResult<MerchantAccessAuthResp> merchantAccessAuthPage(MerchantAccessAuthPageReq merchantAccessAuthPageReq);


    CommonResult<PageResult<MerchantAccessAuthDetailResp>> merchantAccessSnAuthPage(MerchantAccessSnAuthPageReq merchantAccessAuthPageReq);

    /**
     * 修改AUT状态
     * @param updateStateReq
     * @return
     */
    CommonResult<Void> updateAccessAuthState(UpdateMerchantAccessAuthStateReq updateStateReq);

    CommonResult<Void> updateAccessAuth(MerchantAccessAuthDO merchantAccessAuthDO);

    /**
     *
     * @param updateStatusReq
     * @return
     */
    CommonResult<Void> updateAccessAuthLimitRouter(UpdateMerchantAccessAuthStateReq updateStatusReq);

    /**
     *
     * @param id
     * @return
     */
    CommonResult<Void> delAuth(Long id);

    /**
     * 变更产品
     * @param merchantProductReq
     * @return
     */
    CommonResult<MerchantProductReq> updateProduct(@Valid MerchantProductReq merchantProductReq);

    /**
     * 变更产品进度查询
     * @param merchantProductReq
     * @return
     */
    CommonResult<MerchantProductQueryResp> queryProduct(@Valid MerchantProductReq merchantProductReq);


    String randomMchId(String subMchId, PayEnums.PAY_TYPE payType);

    MerchantAccessAuthDO randomMchIdByChannelCode(String channelCode, PayEnums.PAY_TYPE payType);
}
